<?php
    include_once('connect.php');
    
    $name = $_POST['id'];
    $pass = $_POST['pass'];
    $sql_login = "SELECT use_name
                  FROM user
                  WHERE use_name like '".$name."' and use_pass like '".$pass."'  ";
                  
    $res_login = mysql_query($sql_login);
    while($row = mysql_fetch_array($res_login)){
        $user['use_name'] = $row['use_name'];
    }
    $num_row = mysql_num_rows($res_login);
    //if($num_row = 0 ){
        $user['status'] = 1;
        $_SESSION['ses_name'] = $user['use_name'];
    //};
    exit(json_encode($user));
?>